package day2001;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;

public class bbb {
    public static void main(String[] args) throws Exception {
        Class a = anli.class;
        Field[] b = a.getDeclaredFields();
        for(Field c : b){
            System.out.println(c.getName()+" "+c.getType().getName());
        }
        Field e= a.getDeclaredField("age");
        Constructor f = a.getDeclaredConstructor();
        f.setAccessible(true);
        Object g = f.newInstance();
        e.set(g,20);
        System.out.println(e.get(g));
    }
}
